package com.aaa.controller;

import com.aaa.annotation.SysLog;
import com.aaa.entity.ReportVo;
import com.aaa.service.CTakeService;
import com.aaa.utils.Page;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.sun.corba.se.spi.ior.ObjectKey;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * 门诊取药
 */
@Controller
@RequestMapping("caotake")
public class CTakeConter {
    @Autowired
    private CTakeService cTakeService;
    @RequestMapping("seltake")
    private Object seltake(){
        return "cao/Cquyao";
    }
    //查询所有患者信息
    @RequestMapping("tselpreson")
    @ResponseBody
    @SysLog("查询所有患者信息------------>>>>>>>>>>>>>>")
    public Object tselperson(Integer page, Integer limit){
        System.out.println("查询所有患者信息------------>>>>>>>>>>>>>>");
        List<ReportVo> sel = cTakeService.sel();
        return new Page().page(sel,limit,page);
    }
    //修改用户状态
    @RequestMapping("chuku")
    @ResponseBody
    public Object chuku(ReportVo reportVo){
        Integer chuku = cTakeService.chuku(reportVo);
        return chuku;
    }
    //进入查看患者页面
    @RequestMapping("haun")
    public Object haun(){

        return "cao/chuanzhe";
    }
    //查看患者信息
    @RequestMapping("selhuan")
    @ResponseBody
    public Object selhuan(ReportVo reportVo,Integer page, Integer limit){
        List<ReportVo> selhuan = cTakeService.selhuan(reportVo);
        return new Page().page(selhuan,limit,page);
    }
    //查看该用户的总价格
    @RequestMapping("zong")
    @ResponseBody
    public Object zong(Integer reid){
        int zong = cTakeService.zong(reid);
        return zong;
    }
}
